<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>sipML5: SIP Stack</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="sipml-45x51.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">sipML5
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">World&#39;s first HTML5 SIP Client</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div>
<div class="header">
  <div class="headertitle">
<div class="title">SIP Stack </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The SIP stack is the base object used to create all sessions (registration, publication, call...). You must create a stack before starting to make or receive calls. </p>
<h2>Creating a SIP Stack</h2>
<div class="fragment"><pre class="fragment">var o_stack = <span class="keyword">new</span> <a class="code" href="classtsip__stack.html">tsip_stack</a>(<span class="stringliteral">&quot;doubango.org&quot;</span>, <span class="stringliteral">&quot;alice&quot;</span>, <span class="stringliteral">&quot;sip:alice@doubango.org&quot;</span>, <span class="stringliteral">&quot;192.168.0.12&quot;</span>, 5062,
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ada33ff0fb5a3e9e683595e0f8d1aa764">SetPassword</a> (<span class="stringliteral">&quot;mysecret&quot;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">SetDisplayName</a>(<span class="stringliteral">&quot;alice&quot;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&quot;User-Agent&quot;</span>, <span class="stringliteral">&quot;IM-client/OMA1.0 sipML5/v0.0.0000.0&quot;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&quot;Organization&quot;</span>, <span class="stringliteral">&quot;Doubango Telecom&quot;</span>)
);
</pre></div><ul>
<li>'doubango.org': SIP domain name a.k.a. <em>realm</em></li>
<li>'alice': Your IMS Private Identity a.k.a <em>authentication name</em></li>
<li>'sip:<a href="#" onclick="location.href='mai'+'lto:'+'ali'+'ce'+'@do'+'ub'+'ang'+'o.'+'org'; return false;">alice<span style="display: none;">.nosp@m.</span>@dou<span style="display: none;">.nosp@m.</span>bango<span style="display: none;">.nosp@m.</span>.org</a>': Your IMS Public Identity a.k.a <em>SIP address</em></li>
<li>'192.168.0.12': WebSocket outbound proxy Host. Must be a SIP server supporting SIP over WebSockets as per <a href="http://tools.ietf.org/html/draft-ibc-sipcore-sip-websocket-02">draft-ibc-sipcore-sip-websocket-02</a>. If your SIP server don't support this protocol then replace the host address by <b>simpl5.org</b>. When using <b>sipML5</b> outbound proxy, all crequests will be forward to your SIP server according to the result of DNS NAPTR + SRV (realm).</li>
<li>5062: Websocket outbound proxy port</li>
</ul>
<p>In the above example, the SIP stack is created to connect to a SIP server/proxy supporting SIP o/ WebSocket at '192.168.0.12:5062'. All requests received through the WebSocket channel will be forwarded to 'doubango.org' using UDP, TCP or TLS protocol.</p>
<div class="image">
<img src="global_view.png" alt="global_view.png"/>
<div class="caption">
Global View</div></div>
 <h2>Setting Outbound Proxy</h2>
<p>It could be useful define an outbound proxy if no DNS entries are defined for the defined <em>realm</em>. Please note that this outbound proxy could be defined at the stack creation like this: </p>
<div class="fragment"><pre class="fragment">var o_stack = <span class="keyword">new</span> <a class="code" href="classtsip__stack.html">tsip_stack</a>(....
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#aa40a9daa718da1c25a757ef8a8c47cad">SetProxyOutBound</a>(<span class="stringliteral">&quot;192.168.0.10&quot;</span>, 5060, tsip_transport_type_e.UDP)
);
</pre></div> </div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Wed May 16 2012 23:47:02 for sipML5 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
